<?php $myLib = new myLib(); ?>
<div style="float: right;padding: 10px;">
    <a href="<?php echo url_for('@homepage') ?>"><b>Volver a Opinics</b></a>
</div>
<div id="configuration_menu">
<ul>
    <li><a href="<?php echo url_for('@dashboard') ?>">Configuraci&oacute;n</a></li>
    <?php if($sf_user->hasCredential('author')){ ?>
    <li><a href="<?php echo url_for('@articles_new') ?>">Escribir un artículo</a></li>
    <?php } ?>
    <li class="selected"><a href="<?php echo url_for('@history') ?>">Historial</a></li>
</ul>
</div>
<div id="configuration_content">
  <div id="configuration_in">
    <div class="section">
      <div class="title">
          <div>HISTORIAL</div>
      </div>
      <div class="body">
        <table border="1" cellpadding="15">
          <tr class="table">
            <td><b>&uacute;ltima visita</b></td>
            <td><b>art&iacute;culo</b></td>
            <td><b>visto</b></td>
          </tr>
          <?php if(count($items)>0){ ?>
          <?php foreach($items as $item){ ?>
          <tr class="table2">
            <td bgcolor="#cdd2d6">
              <?php echo $myLib->formattedDate3($item->getCreatedAt()) ?>
            </td>
            <td style="width: 795px;">
              <?php if($item->getArticle()->getEnabled()==1){ ?>
              <a href="<?php echo url_for('@article?id='.$item->getArticle()->getId().'&slug='.$item->getArticle()->getSlug()) ?>">
                <?php echo $item->getArticle()->getTitle() ?></a>
              <?php }else{ ?>
                <label style="text-decoration: line-through;"><?php echo $item->getArticle()->getTitle() ?></label>
              <?php } ?>
            </td>
            <td>
                <?php echo $item->getViews() ?> times
            </td>
          </tr>
          <?php } ?>
          <?php }else{ ?>
          <tr class="table">
            <td colspan="6">
                No existen registros en su historial.
            </td>
          </tr>
          <?php } ?>
        </table>
      </div>
    </div>
  </div>
</div>